package com.aboo.file2;

import java.io.BufferedReader;
import java.io.IOException;

public class ReadKit {

    private BufferedReader br;

    public ReadKit(BufferedReader br) {
        this.br = br;
    }

    public synchronized boolean read() throws IOException {
        String threadName = Thread.currentThread().getName();
        String msg = br.readLine();
        if (msg != null) {
            System.out.println(threadName + "-->" + msg);
            return true;
        }
        return false;
    }

}
